#include <stdio.h>

int fib(int N){

	int num1 = 1;
	int num2 = 1;
	int tmp = 0;
	int i = 0;
    if(N==0)
    {
        return 0;
    }
	else if (N<=2)
	{
		return 1;
	}
	else
	{
		for (i = 0; i<N-2; i++)
		{
			tmp = num1 + num2;
			num1 = num2;
			num2 = tmp;
		}
		return tmp;
	}
}
int main(int argc,char* argv[])
{
	if(argc!=2)
	{
		printf("Enter: fibonacci [num]\n");
		return 1;
	}
	int N = atoi(argv[1]);
    printf("%d\n",fib(N));
    return 0;
}
